# 多个数据元组
t1 = (10, 20, 30)
# 单个数据元组
t2 = (10,)

t2 = (10,)
print(type(t2)) # tuple
t3 = (20)
print(type(t3)) # int
t4 = ('hello')
print(type(t4)) # str

tuple1 = ('aa', 'bb', 'cc', 'bb')
print(tuple1[0]) # aa

# index()
tuple1 = ('aa', 'bb', 'cc', 'bb')
print(tuple1.index('aa')) # 0

#count()
tuple1 = ('aa', 'bb', 'cc', 'bb')
print(tuple1.count('bb')) # 2

# len()
tuple1 = ('aa', 'bb', 'cc', 'bb')
print(len(tuple1)) # 4

#元组里面有列表，修改列表里面的数据则是支持的
tuple2 = (10, 20, ['aa', 'bb', 'cc'], 50, 30)
print(tuple2[2]) # 访问到列列表
# 结果：(10, 20, ['aaaaa', 'bb', 'cc'], 50, 30)
tuple2[2][0] = 'aaaaa'
print(tuple2)
